package com.studyweb.pojo.entity;

import java.time.LocalDateTime;

/**
 * 试卷实体类
 */
public class Paper {
    private Long id;
    private String name;
    private Integer totalDuration; // 总时长(分钟)
    private Integer totalQuestions; // 总题数
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    // 构造函数
    public Paper() {}

    public Paper(String name, Integer totalDuration, Integer totalQuestions) {
        this.name = name;
        this.totalDuration = totalDuration;
        this.totalQuestions = totalQuestions;
        this.createTime = LocalDateTime.now();
        this.updateTime = LocalDateTime.now();
    }

    // Getter和Setter方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getTotalDuration() {
        return totalDuration;
    }

    public void setTotalDuration(Integer totalDuration) {
        this.totalDuration = totalDuration;
    }

    public Integer getTotalQuestions() {
        return totalQuestions;
    }

    public void setTotalQuestions(Integer totalQuestions) {
        this.totalQuestions = totalQuestions;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "Paper{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", totalDuration=" + totalDuration +
                ", totalQuestions=" + totalQuestions +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}